package club.hiuit.share.kuaidi100.config;

import club.hiuit.share.kuaidi100.entity.KuaidiProperties;
import club.hiuit.share.kuaidi100.api.Kuaidi100NetCenter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(KuaidiProperties.class)
@ComponentScan("club.hiuit.share.kuaidi100")
public class Kuaidi100Configurations {

    @Autowired
    public KuaidiProperties kuaidiProperties;

    @Bean
    public Kuaidi100NetCenter kuaidi100NetCenter(){
        Kuaidi100NetCenter kuaidi100NetCenter = new Kuaidi100NetCenter(kuaidiProperties);
        return kuaidi100NetCenter;
    }
}
